/**
 * @param {Array} buttons - Array of button objects
 * @param {string} buttons[].text - Text to display on the button
 * @param {Function} buttons[].click - Function to call when the button is clicked
 */

// create Dom element for each button
export const createButtonGroup = (buttons) => {
    const buttonGroup = document.createElement('div')
    buttonGroup.style.cssText = `
        position: fixed;
        top: 0;
        right: 0;
        z-index: 999;
        `
    buttons.forEach((button) => {
        const buttonElement = document.createElement('button')
        buttonElement.style.cssText = `
        font-size: 20px;
        margin: 5px;
        cursor: pointer;
        `
        buttonElement.textContent = button.text
        buttonElement.addEventListener('click', button.click)
        buttonGroup.appendChild(buttonElement)
    })

    document.body.appendChild(buttonGroup)
}
